package com.code.base.dic.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.dic.persistence.DicZoneMapper;
import com.code.base.dic.pojo.DicZone;
import com.code.util.PrimaryKeyUtil;


@Service
public class DicZoneService {


	@Resource
	private DicZoneMapper dicZoneMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public DicZone getDataById(Long id) {
		return dicZoneMapper.getDataById(id);
	}

	public List<DicZone> getAllData() {
		return dicZoneMapper.getAllData();
	}

	public int getDataCountByCondition(DicZone entity) {
		return dicZoneMapper.getDataCountByCondition(entity);
	}

	public List<DicZone> getDataByCondition(DicZone entity) {
		return dicZoneMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(DicZone entity) {
		return dicZoneMapper.getDataCountByLikeCondition(entity);
	}

	public List<DicZone> getDataByLikeCondition(DicZone entity) {
		return dicZoneMapper.getDataByLikeCondition(entity);
	}

	public List<DicZone> getDataByIds(Long[] ids) {
		return dicZoneMapper.getDataByIds(ids);
	}

	public void insertData(DicZone entity) {
		insertData(entity, true);
	}

	public void insertData(DicZone entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		dicZoneMapper.insertData(entity);
	}

	public void updateData(DicZone entity) {
		dicZoneMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		dicZoneMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(DicZone entity) {
		dicZoneMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		dicZoneMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		dicZoneMapper.deleteDataByIds(ids);
	}

}
